﻿
/* ==============================================================================
*
*   Copyright (c) 2010, Pierre Favier
*   All rights reserved.
*
*   NTasking is free software: you can redistribute it and/or modify it
*   under the terms of the GNU General Public License as published by the
*   Free Software Foundation.
*
*   Redistribution and use in source and binary forms, with or without
*   modification, are permitted provided that the following conditions
*   are met:
*
*   -   Redistributions of source code must retain the above copyright notice,
*       this list of conditions and the following disclaimer.
*
*   -   Redistributions in binary form must reproduce the above
*       copyright notice, this list of conditions and the following
*       disclaimer in the documentation and/or other materials
*       provided with the distribution.
*
*   THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
*   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
*   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
*   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
*   BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
*   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
*   TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
*   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
*   ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
*   TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
*   THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
*   SUCH DAMAGE.
*
* ============================================================================== */

// This code has been generated by the T4 engine. DO NOT EDIT otherwise your changes
// will be overwritten at next generation

using System;

namespace NTasking
{

    /// <summary>
    /// Implement Ada selective call statements
    /// </summary>
    public partial class SelectiveCall
    {
        
        #region For methods with 0 parameters

        /// <summary>
        /// Add a selective call alternative.
        /// </summary>
        /// <param name="selectiveCall">The call to be performed selectively.</param>
        /// <returns></returns>
        public Func<AfterActionCall> Call(Action selectiveCall)
        {
            return GetCall<Action, Func<AfterActionCall>>(selectiveCall);
        }


        /// <summary>
        /// Add a selective call alternative.
        /// </summary>
        /// <typeparam name="RetT">The type of the result.</typeparam>
        /// <param name="selectiveCall">The call to be performed selectively.</param>
        /// <returns></returns>
        public Func<AfterFuncCall<RetT>> Call<RetT>(Func<RetT> selectiveCall)
        {
            return GetCall<Func<RetT>, Func<AfterFuncCall<RetT>>>(selectiveCall);
        }

        #endregion


        #region For methods with 1 parameters

        /// <summary>
        /// Add a selective call alternative.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <param name="selectiveCall">The call to be performed selectively.</param>
        /// <returns></returns>
        public Func<P1T, AfterActionCall> Call<P1T>(Action<P1T> selectiveCall)
        {
            return GetCall<Action<P1T>, Func<P1T, AfterActionCall>>(selectiveCall);
        }


        /// <summary>
        /// Add a selective call alternative.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="RetT">The type of the result.</typeparam>
        /// <param name="selectiveCall">The call to be performed selectively.</param>
        /// <returns></returns>
        public Func<P1T, AfterFuncCall<RetT>> Call<P1T, RetT>(Func<P1T, RetT> selectiveCall)
        {
            return GetCall<Func<P1T, RetT>, Func<P1T, AfterFuncCall<RetT>>>(selectiveCall);
        }

        #endregion


        #region For methods with 2 parameters

        /// <summary>
        /// Add a selective call alternative.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <param name="selectiveCall">The call to be performed selectively.</param>
        /// <returns></returns>
        public Func<P1T, P2T, AfterActionCall> Call<P1T, P2T>(Action<P1T, P2T> selectiveCall)
        {
            return GetCall<Action<P1T, P2T>, Func<P1T, P2T, AfterActionCall>>(selectiveCall);
        }


        /// <summary>
        /// Add a selective call alternative.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="RetT">The type of the result.</typeparam>
        /// <param name="selectiveCall">The call to be performed selectively.</param>
        /// <returns></returns>
        public Func<P1T, P2T, AfterFuncCall<RetT>> Call<P1T, P2T, RetT>(Func<P1T, P2T, RetT> selectiveCall)
        {
            return GetCall<Func<P1T, P2T, RetT>, Func<P1T, P2T, AfterFuncCall<RetT>>>(selectiveCall);
        }

        #endregion


        #region For methods with 3 parameters

        /// <summary>
        /// Add a selective call alternative.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <param name="selectiveCall">The call to be performed selectively.</param>
        /// <returns></returns>
        public Func<P1T, P2T, P3T, AfterActionCall> Call<P1T, P2T, P3T>(Action<P1T, P2T, P3T> selectiveCall)
        {
            return GetCall<Action<P1T, P2T, P3T>, Func<P1T, P2T, P3T, AfterActionCall>>(selectiveCall);
        }


        /// <summary>
        /// Add a selective call alternative.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="RetT">The type of the result.</typeparam>
        /// <param name="selectiveCall">The call to be performed selectively.</param>
        /// <returns></returns>
        public Func<P1T, P2T, P3T, AfterFuncCall<RetT>> Call<P1T, P2T, P3T, RetT>(Func<P1T, P2T, P3T, RetT> selectiveCall)
        {
            return GetCall<Func<P1T, P2T, P3T, RetT>, Func<P1T, P2T, P3T, AfterFuncCall<RetT>>>(selectiveCall);
        }

        #endregion


        #region For methods with 4 parameters

        /// <summary>
        /// Add a selective call alternative.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <param name="selectiveCall">The call to be performed selectively.</param>
        /// <returns></returns>
        public Func<P1T, P2T, P3T, P4T, AfterActionCall> Call<P1T, P2T, P3T, P4T>(Action<P1T, P2T, P3T, P4T> selectiveCall)
        {
            return GetCall<Action<P1T, P2T, P3T, P4T>, Func<P1T, P2T, P3T, P4T, AfterActionCall>>(selectiveCall);
        }


        /// <summary>
        /// Add a selective call alternative.
        /// </summary>
        /// <typeparam name="P1T">The type of parameter 1</typeparam>
        /// <typeparam name="P2T">The type of parameter 2</typeparam>
        /// <typeparam name="P3T">The type of parameter 3</typeparam>
        /// <typeparam name="P4T">The type of parameter 4</typeparam>
        /// <typeparam name="RetT">The type of the result.</typeparam>
        /// <param name="selectiveCall">The call to be performed selectively.</param>
        /// <returns></returns>
        public Func<P1T, P2T, P3T, P4T, AfterFuncCall<RetT>> Call<P1T, P2T, P3T, P4T, RetT>(Func<P1T, P2T, P3T, P4T, RetT> selectiveCall)
        {
            return GetCall<Func<P1T, P2T, P3T, P4T, RetT>, Func<P1T, P2T, P3T, P4T, AfterFuncCall<RetT>>>(selectiveCall);
        }

        #endregion

    }

}
